from xpcom import components, verbose


class ContentPolicyPython:
    _com_interfaces_ = components.interfaces.nsIContentPolicy
    _reg_clsid_ = "{648639fb-05a4-4695-a3a4-9cd9607951e6}"
    _reg_contractid_ = "@ucweb.com/myfun;1"

  def __init__(self):
    print 'brasil!!!!!!!!!!!!!!!!!!!!!----------------------------------****************************--------------basil'
    logging.getLogger('errinfo').debug('brasil!!!!!!!!---world cup!!!')

  def __del__(self):
    logging.getLogger('errinfo').debug('bye bye ----------testing-----rio')
    pass

def shouldLoad(self,aContentType,aContentLocation,aRequestOrigin,aContext,aMimeTypeGuess,aExtra):
    print 'world cup!!!!!!!!!!!!!!!!!!!!!!!!!---------------------------------------------------------------------*************basil'
    print 'type=' , (aContentType)
    logging.getLogger('errinfo').debug('type=%d' % (aContentType))
    if 2 == aContentType or 4 == aContentType or 3 == aContentType or 7 == aContentType:
        logging.getLogger('errinfo').debug('rejecting type=%d' % (aContentType))
        print str(aContentLocation)
        return (-2)
    return 1